import java.util.ArrayList;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        int[] array={5,0,3,6,7};
        System.out.println(Arrays.toString(array));

        Main.sort(array);
        System.out.println(Arrays.toString(array));


    }
    public static void sort(int[] array){
        for (int i = 1; i < array.length; i++) {
            int j=i-1;
            int tmp=array[i];
            while(j>=0) {
                if (array[j] > tmp) {
                    array[j + 1] = array[j];
                    j--;
                } else {
                    array[j + 1] = tmp;
                    break;
                }
                array[j + 1] = tmp;
            }
        }
    }
}